package com.example.demo.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author lck
 * @date 2020/10/20 14:23
 * @description
 */
@Component
public class TestTask {

	private static Logger logger = LoggerFactory.getLogger(TestTask.class);

	private static int num = 1;


	@Scheduled(cron = "*/1 * * * * ?")
	public void test3(){
		logger.info("模拟日志info：num = " + num);
		logger.error("模拟日志error：num = " + num);
		int a = 20/(num-20);
		num++;
	}

}
